using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_ZERORATESMap : EntityTypeConfiguration<SO_ZERORATES>
    {
        public SO_ZERORATESMap()
        {
            // Primary Key
            this.HasKey(t => t.SYMBOL);

            // Properties
            this.Property(t => t.SYMBOL)
                .IsRequired()
                .HasMaxLength(5);

            // Table & Column Mappings
            this.ToTable("SO_ZERORATES");
            this.Property(t => t.DATE).HasColumnName("DATE");
            this.Property(t => t.CURRENCY).HasColumnName("CURRENCY");
            this.Property(t => t.SYMBOL).HasColumnName("SYMBOL");
        }
    }
}
